<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta content="telephone=no" name="format-detection" />
    <!-- 留作将来统一添加 -->
    <TEMPLATE>${TEMPLATE}</TEMPLATE>
    <title>模板html</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css">
    <link rel="stylesheet" type="text/css" href="../../css/index.css">
    <link rel="stylesheet" type="text/css" href="../../css/data-flex.min.css">
    <style type="text/css">
        body {
            background: rgba(90, 194, 255, 1);
        }

        .container {
            margin: 15px;
            background: rgba(255, 255, 255, 1);
            box-shadow: 0px 4px 10px 0px rgba(0, 135, 214, 0.37);
            border-radius: 8px;
            padding: 0 15px;
        }

        .head {
            height: 44px;
        }

        .bor {
            height: 1px;
            background: rgb(212, 212, 212);
            transform: translateY(0.5);
        }

        .head-title {
            font-size: 15px;
            font-weight: 400;
            color: rgba(25, 25, 25, 1);
        }

        .head-text {
            font-size: 16px;
            font-weight: 500;
            color: rgba(255, 101, 24, 1);
        }

        .head-text-gray {
            font-size: 16px;
            font-weight: 500;
            color: rgba(128, 128, 128, 1);
        }

        .book {
            height: 80px;
            margin: 10px 0;
        }

        .book-img {
            width: 60px;
            height: 80px;
            margin-right: 12px;
            min-width: 60px;
        }

        .book-txt {
            height: 36px;
            font-size: 14px;
            font-weight: 500;
            color: rgba(51, 51, 51, 1);
            line-height: 18px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
        }

        .footer {
            height: 66px;
        }

        .footer-title {
            line-height: 23px;
            font-size: 15px;
            font-weight: 400;
            color: rgba(25, 25, 25, 1);
        }

        .footer-time {
            line-height: 21px;
            font-size: 13px;
            font-weight: 400;
            color: rgba(128, 128, 128, 1);
        }

        .footer-small {
            height: 44px;
        }
    </style>
</head>

<body>
    <div class="vueApp" v-cloak>
        <div v-if="listData.length > 0">
            <div class="container" v-for="item,index in listData" @click="handleItem(item)">
                <div class="head" data-flex="main:justify cross:center">
                    <div class="head-title">
                        {{ item.configDescribe }}
                    </div>
                    <div
                        :class="item.recordTypeConfigId == 1 && item.auditStatus == 3 ? 'head-text-gray' : 'head-text'">
                        ¥{{ item.tradeMoney }}
                    </div>
                </div>
                <div class="bor" v-if="item.recordTypeConfigId == 3"></div>
                <div class="book" v-if="item.recordTypeConfigId == 3" data-flex>
                    <div class="book-img">
                        <img :src="item.pic" alt="">
                    </div>
                    <div class="book-txt" data-flex-box="1">
                        {{ item.name }}
                    </div>
                </div>
                <div class="bor"></div>
                <div :class="item.recordTypeConfigId != 2 ? 'footer' : 'footer-small'" data-flex="cross:center">
                    <div>
                        <div class="footer-title" v-if="item.recordTypeConfigId != 2">
                            {{item.orderSn ? '订单号' : '提现单号'}}:{{ item.orderSn || item.recordNumber }}</div>
                        <div class="footer-time">{{ item.createDate }}</div>
                    </div>
                </div>
            </div>
        </div>
        <div v-else-if="isLoad" class="data-null">
            <p>暂时没有更多数据哦</p>
        </div>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/service/service-tool.js"></script>
<script type="text/javascript" src="../../script/service/service-app.js"></script>
<script type="text/javascript" src="../../script/service/service-user.js"></script>
<script type="text/javascript" src="../../script/service/service-logic.js"></script>
<script type="text/javascript" src="../../script/jquery.min.js"></script>
<script type="text/javascript" src="../../script/vue.min.js"></script>
<script type="text/javascript">
    // html 的引号一律为双引号(""),js 为单引号('')
    var USER, $S, vm;
    apiready = function () {
        $S = SERVICE();
        USER = USER();
        console.log(JSON.stringify(api.pageParam) + '=====pageParam');
        fnInit();
    };
    // 初始化
    function fnInit() {
        vm = new Vue({
            el: '.vueApp',
            data: {
                listData: [],
                pageNo: 1,
                pageSize: 10,
                isLoad: false
            }
        });
        load();
    }

    function load() {
        getPageData('headerRefreshing');
        fnAddHeaderRefreshingEvent(function () { //设置下拉刷新
            getPageData('headerRefreshing');
        });

        fnAddFooterLoadingEvent(function () { // 设置上拉加载
            getPageData('load');
        });
    }

    function getPageData(sign) {
        if (sign == 'headerRefreshing') {
            vm.pageNo = 1;
        } else {
            vm.pageNo++;
        }
        var url = 'my/getIncomeDetailsList';
        var params = {
            'pageNo': vm.pageNo,
            'pageSize': vm.pageSize
        };
        var callback = function (data) {
            if (vm.pageNo == '1') {
                vm.listData = [];
            }
            var listData = data.listData;
            for (var i = 0; i < listData.length; i++) {
                var item = listData[i];
                item.createDate = formatTime(item.createDate, 'order_date');
                // if (item.recordTypeConfigId == 1) {
                //     item.recordTypeConfigIdText = '提现';
                // } else if (item.recordTypeConfigId == 2) {
                //     item.recordTypeConfigIdText = '充值';
                // } else if (item.recordTypeConfigId == 3) {
                //     item.recordTypeConfigIdText = '购买视频';
                // }
            }
            vm.listData = vm.listData.concat(listData);
            vm.isLoad = true;
            // status 为200时,只返回data
        };
        var error = function (res) {
            // status 不是200时,全部返回
            api.refreshHeaderLoadDone();
        };
        POST(url, params, callback, error);
    }

    function handleItem(item) {

    }
</script>

</html>